var mongoose=require('mongoose');
var gymDetailSchema=new mongoose.Schema(
	{//Schema
		name:{
				type:String
			}
		city:String,
		location:[Number],
		comments:String
	}//Schema
	);

gymDetailSchema.pre('save',function(next){
	console.log('保存成功');
	next();});

gymDetailSchema.statics={
	fetch:function(cb){
		return this.find({}).sort('').exec(cb);
	},
	findById:function(id,cb){
		return this.find({_id:id}).sort('').exec(cb);
	}
}

module.exports=gymDetailSchema;